<template>
  <div class="hello">
   <div class="top">
    <div class="logo">
      <img src="https://img601.yun300.cn/repository/image/fa5648aa-7f94-41fd-9457-a657bc8fcbb1.jpg?tenantId=215997&viewType=1&k=1642041118000" alt="">
    </div>
    <div class="list">
      <!-- 定义跳转的方法,点击获取参数来跳转页面 -->
      <div class="item" v-for="(item,index) in list" :key="index" @click="jump(item.url)">
      {{ item.name }}
      </div>
    </div>
   </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      list:[
      {
        name:'首页',
        url:'/'
      },
      {
        name:'脉络',
        url:'/land'
      },
      {
        name:'建筑',
        url:'/build'
      },
      {
        name:'画语',
        url:'/about'
      },
      {
        name:'新闻',
        url:'/news'
      },
      ]
    }
  },
  methods:{
    // 根据点击获取的参数来跳转页面
    jump(url){
      this.$router.push(url)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">

.top{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 120px;
  z-index: 50;
  display: flex;
  box-sizing: border-box;
  padding:10px 2%;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  .logo{
  img{
    width: 65px;
    height: 100px;
  }
}
  .list{
    display: flex;
    margin-right: 10%;
    .item{
      width: 100px;
      font-size: 20px;
    height: 100px;
    line-height: 100px;
    transition:1s;
    }
    .item:hover{
      cursor: pointer;
      color: #fff;
  background: #c5a544;
    }
  }
}
</style>
